package com.snxun.browser_light.utils;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.lodz.android.pandora.widget.rv.drag.DragHelperCallback;

/**
 * 拖拽帮助类
 * Created by Yangjw on 2020/11/19.
 */
public class DragCallbackHelper<T> extends DragHelperCallback<T> {
    @Override
    public int interpolateOutOfBoundsScroll(@NonNull RecyclerView recyclerView, int viewSize, int viewSizeOutOfBounds, int totalSize, long msSinceStartScroll) {
        // 重写加速度方法，自定义滚动加速度的值
        int value = super.interpolateOutOfBoundsScroll(recyclerView, viewSize, viewSizeOutOfBounds, totalSize, msSinceStartScroll);
        return value >= 0 ? 10 : -10;
    }
}
